.netCHARTING v5.1 Documentation Send comments on this topic.
Elements And Axis Scales
See Also
Getting Started > General Tutorials > Chart Type Anatomy 101 > Element Layout Control > Elements And Axis Scales

Glossary Item Box

Introduction

While there are many options for scales, .netCHARTING can automatically determine the appropriate scales based on your data. This tutorial will demonstrate how element data influences axis scales.

 

The Y Axis ( value axis )

We will call this the y axis but by 'value axis' we don't literally mean (Y) axis. With ChartType.ComboHorizontal for instance we would be referring to the x axis. For all others however it is the y axis. The element values that influence this axis are

 

[New in v5.0]
The elements of a series can be excluded from the axis scale range using Series.ExcludeFromAxisRange = true

The automatically chosen axis scales here are either Normal or Time. It is determined by whether the YValue (numeric) or YDateTime (time) values are specified for each element.

The following table shows value settings of these element properties that the chart engine will consider not set.

  • YValue & YValueStart
    Setting: double.NaN
  • YDateTime & YDateTimeStart
    Setting: DateTime.MinValue

 

The X Axis (Category / Value Axis)

Y Axis using ChartType.ComboHorizontal

The x axis is very powerful, it can operate just like the y axis value axis as well as a category axis. If the elements have names (Element.Name) specified, the axis scale will be a category scale. However, if the elements have either XValue or XDateTime properties set, the appropriate value axis scale will be chosen.

The element properties that influence the x axis type are:

 

Even if all numeric or time values are provided, setting any of the element's Name properties will yield a category axis scale and values will become names for elements without specified names.
 
The data engine will always provide elements with both,  names and values if the names represent numeric or time values. By default this creates a category scale. To use a value scale instead, set the axis scale property to the appropriate scale. Scale.Normal for numeric and Scale.Time for date time values.
Setting the scale through DefaultAxis.Scale will not produce the same result.
 
[C#]

Chart.XAxis.Scale = Scale.Time;
[Visual Basic]

Chart.XAxis.Scale = Scale.Time
 
Smart Category Axis
 
A smart category axis scale is one that contains elements with names and values but the names are string representations of the value properties. The 'smart' part is that despite it being a category (string) axis, the elements will be sorted in sequence based on the values they represent.
 
To use this axis type you must use the DataEngine and specify 'XAxis=valueDBColumn' in its DataFields property.

See Also

©2002 - 2008 Webavail Productions Inc. & Corporate Web Solutions Ltd. All Rights Reserved.